/**
 * Created by Administrator on 2017/12/4.
 */
import React from 'react';
import {
    R_header_fixed
} from '../common/index'
import './style/business.scss'
import Sunflower from './img/sunflower.jpg'
import {
    HttpService,
    dateFormat,
    browser,
    GetDateStr,
    ApiUploadImg,
    fmtDate
} from '../../Tools'
export  default  class CompanyData extends React.Component {
    constructor(props) {
        super(props);
        this.state={
            dataList:[]
        }
    }

    componentWillMount(){
        var rec = this;
        HttpService.query({
            url: '/jf/business/company/getByCompanyUser',
            data: {
                token: localStorage.btoken
            },
            success: (res => {
                if (res.code = "10140") {
                        rec.setState({
                            dataList:res.data
                        })
                }else{
                    Tips(res.data);
                }
            })
        })
    }

    componentDidMount() {

    }

    render() {
        const {dataList}=this.state;
        // let logo=imgUrl+'/images/'+dataList.logo;
        // let license=imgUrl+'/images/'+dataList.businessLicence

        let logo='';
        let license=''
        if(dataList.logo){
            logo=dataList.logo;
        }

        if(dataList.businessLicence){
            license=dataList.businessLicence
        }
        let areaBox;
        if(dataList.intentArea){
            const intentArea=dataList.intentArea.split('&');
            areaBox=intentArea.map(function(item) {
                return (
                    <span>{item}</span>
                )
            }.bind(this))
        }

        return (
            <div >
                <R_header_fixed left="1" title="企业详情"/>
                <div className="companyData">
                    <ul className="companyInfo">
                        <li>
                            <label htmlFor="">商家名称：</label>
                            <span>{dataList.name}</span>
                        </li>
                        <li>
                            <label htmlFor="">经营类别：</label>
                            <span>{dataList.businessType}</span>
                        </li>
                        <li>
                            <label htmlFor="">联系人：</label>
                            <span>{dataList.linkPeople}</span>
                        </li>
                        <li>
                            <label htmlFor="">联系人职务：</label>
                            <span>{dataList.linkPeopleJob}</span>
                        </li>
                        <li>
                            <label htmlFor="">联系电话：</label>
                            <span>{dataList.linkPhone}</span>
                        </li>
                        <li>
                            <label htmlFor="">商家地址：</label>
                            <span>{dataList.address}</span>

                        </li>
                        <li>
                            <label htmlFor="">合作意向区域：</label>
                            <span>{dataList.intentArea}</span>
                        </li>
                        <li>
                            <label htmlFor="">商家logo：</label>
                            <img src={logo} alt="营业执照扫描件"/>
                        </li>
                        <li>
                            <label htmlFor="">营业执照：</label>
                            <img src={license} alt="营业执照扫描件"/>
                        </li>
                        <li>
                            <label htmlFor="">商家介绍：</label>
                            <span>{dataList.introduce}</span>
                        </li>

                    </ul>

                </div>
            </div>

        )
    }
}
